#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
    int n, k, s, count = 0;
    scanf("%d%d%d", &n, &k, &s);
    int arr[291] = { 0 };
    for (int i = 0; i < n; i++)
    {
        int tmp1, tmp2;
        scanf("%d%d", &tmp1, &tmp2);
        if (tmp1 > 175)
        {
            if (tmp2 >= s)
                count++;
            else
                arr[tmp1]++;
        }
    }
    for (int i = 0; i < k; i++)
    {
        for (int j = 290; j >= 175; j--)
        {
            if (arr[j] != 0)
            {
                count++;
                arr[j]--;
            }
        }
    }
    printf("%d", count);
    return 0;
}
#include <stdio.h>
int main()
{
    int n, m, q;
    scanf("%d%d%d", &n, &m, &q);
    int arr[n][m];
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            arr[i][j] = 0;
        }
    }
    int x, y;
    for (int i = 0; i < q; i++)
    {
        scanf("%d%d", &x, &y);
        if (x == 0)
        {
            for (int j = 0; j < m; j++)
                arr[y - 1][j] = 1;
        }
        else
        {
            for (int j = 0; j < n; j++)
                arr[j][y - 1] = 1;
        }
    }
    int count = 0;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            if (arr[i][j] == 0)
                count++;
        }
    }
    printf("%d", count);
    return 0;
}
#include <stdio.h>
int main()
{
    int arr[10000] = { 0 };
    int count = 2;
    scanf("%d%d", &arr[0], &arr[1]);
    int n;
    scanf("%d", &n);
    for (int i = 2; i < n; i++)
    {
        int sum = arr[i - 1] * arr[i - 2];
        if (sum > 9)
        {
            arr[count++] = sum / 10;
            arr[count++] = sum % 10;
        }
        else
            arr[count++] = sum;
        if (count >= n)
            break;
    }
    for (int i = 0; i < n; i++)
    {
        if (i == 0)
            printf("%d", arr[i]);
        else
            printf(" %d", arr[i]);
    }
    return 0;
}